package team.niit.service.impl;

import team.niit.dao.StudentDAO;
import team.niit.dao.impl.StudentDAOImpl;
import team.niit.entity.StudentEntity;
import team.niit.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    StudentDAO studentDAO = new StudentDAOImpl();

    @Override
    public boolean modifyPassword(String id, String oldPassword, String newPassword) {
        return false;
    }

    @Override
    public StudentEntity login(StudentEntity student) {
        return null;
    }

    @Override
    public boolean retrievePassword(String id, String password, String phone) {
        return false;
    }

    @Override
    public StudentEntity queryStudentById(String id) {
        return null;
    }

    @Override
    public StudentEntity modifyStudentById(StudentEntity student) {
        return studentDAO.modifyStudentById(student);
    }

    @Override
    public boolean addStudent(StudentEntity student) {
        return studentDAO.addStudent(student);
    }

    @Override
    public StudentEntity modifyStudent(StudentEntity student) {
        return null;
    }

    @Override
    public boolean deleteStudentById(String id) {
        return false;
    }

    @Override
    public List<StudentEntity> selectStudentList() {
        return studentDAO.selectStudentList();
    }


    @Override
    public List<StudentEntity> pagingQuery(int size, int pageNumber) {
        return studentDAO.pagingQuery(size, pageNumber);
    }

    @Override
    public int count() {
        return studentDAO.count();
    }

    @Override
    public StudentEntity[][] queryAllStudent(String id) {
        return new StudentEntity[0][];
    }

    @Override
    public int dropStudent(String studentId) {
        if (studentDAO.dropStudent(studentId)) {
            return 1;
        }
        else {
            return 0;
        }
    }


}
